
<!--流程控制主要包括：循环遍历和条件判断-->
<!--1. 循环控制-->
<?php foreach($users as $key => $user): ?>
<!--<p>-->
<!--    <?php echo $key; ?> :-->
<!--    <?php echo $user['name']; ?>&#45;&#45;-->
<!--    <?php echo $user['age']; ?>&#45;&#45;-->
<!--    <?php echo $user['email']; ?>-->
<!--</p>-->

<p><?=$key?>:<?=$user['name']?>--<?=$user['age']?>--<?=$user['email']?></p>
<?php endforeach; ?>
<hr>
{foreach $users as $key=>$user}
<p>{$key}:{$user['name']}--{$user['age']}--{$user['email']}</p>
{/foreach}

<hr>
{volist name="users" id="user"}
<p>{$key}:{$user['name']}--{$user['age']}--{$user['email']}</p>
{/volist}
<hr>
{// 条件判断}
{foreach $users as $key=>$user}
{if ($user.age > 40)}
<p>{$key}:{$user['name']}--{$user['age']}--{$user['email']}</p>
{/if}
{/foreach}